package com.nuoniu.sibanyun.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.nuoniu.sibanyun.common.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.StringUtils;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 菜单表
 * </p>
 *
 * @author baiqiang
 * @since 2020-04-23
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("sys_menu")
@ApiModel(value="SysMenu对象", description="菜单表")
public class SysMenu extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "父级编号")
    @TableField("parent_id")
    private Integer parentId;

    @ApiModelProperty(value = "所有父级编号")
    @TableField("parent_ids")
    private String parentIds;

    @ApiModelProperty(value = "本级排序号（升序）")
    @TableField("tree_sort")
    private Integer treeSort;

    @ApiModelProperty(value = "所有级别排序号")
    @TableField("tree_sorts")
    private String treeSorts;

    @ApiModelProperty(value = "是否最末级")
    @TableField("tree_leaf")
    private Boolean treeLeaf;

    @ApiModelProperty(value = "层次级别")
    @TableField("tree_level")
    private Integer treeLevel;

    @ApiModelProperty(value = "全节点名")
    @TableField("tree_names")
    private String treeNames;

    @ApiModelProperty(value = "菜单名称")
    @TableField("menu_name")
    private String menuName;

    @ApiModelProperty(value = "页面地址")
    @TableField("view_path")
    private String viewPath;

    @ApiModelProperty(value = "组件名称")
    @TableField("component")
    private String component;

    @ApiModelProperty(value = "重定向路径")
    @TableField("redirect")
    private String redirect;

    @ApiModelProperty(value = "是否缓存页面")
    @TableField("keep_alive")
    private Boolean keepAlive;

    @ApiModelProperty(value = "菜单类型（1菜单 2权限 3内部菜单 4内部tab）")
    @TableField("menu_type")
    private Integer menuType;

    @ApiModelProperty(value = "链接")
    @TableField("menu_href")
    private String menuHref;

    @ApiModelProperty(value = "目标")
    @TableField("menu_target")
    private String menuTarget;

    @ApiModelProperty(value = "图标")
    @TableField("menu_icon")
    private String menuIcon;

    @ApiModelProperty(value = "颜色")
    @TableField("menu_color")
    private String menuColor;

    public void setPermission(String permission) {
        this.permission = StringUtils.trim(permission);
    }

    @ApiModelProperty(value = "权限标识")
    @TableField("permission")
    private String permission;

    @ApiModelProperty(value = "菜单权重 1：默认权限 2：二级管理员 3：系统管理员 4：超级管理员")
    @TableField("weight")
    private Integer weight;

    @ApiModelProperty(value = "是否显示（1显示 0隐藏）")
    @TableField("is_show")
    private Boolean isShow;

    @ApiModelProperty(value = "归属系统（default:主导航菜单、mobileApp:APP菜单）")
    @TableField("sys_code")
    private String sysCode;

    @ApiModelProperty(value = "归属模块（多个用逗号隔开）")
    @TableField("module_codes")
    private String moduleCodes;

    @ApiModelProperty(value = "app是否显示")
    @TableField("is_app_enable")
    private Boolean isAppEnable;

    @ApiModelProperty(value = "app菜单名称")
    @TableField("app_menu_name")
    private String appMenuName;

    @ApiModelProperty(value = "app页面地址")
    @TableField("app_page_path")
    private String appPagePath;

    @ApiModelProperty(value = "app菜单字体图标")
    @TableField("app_icon")
    private String appIcon;

    @ApiModelProperty(value = "状态（0正常 1删除 2停用）")
    @TableField("status")
    private Boolean status;

    @ApiModelProperty(value = "创建者")
    @TableField("create_by")
    private Integer createBy;

    @ApiModelProperty(value = "创建时间")
    @TableField("create_date")
    private LocalDateTime createDate;

    @ApiModelProperty(value = "更新者")
    @TableField("update_by")
    private Integer updateBy;

    @ApiModelProperty(value = "更新时间")
    @TableField("update_date")
    private LocalDateTime updateDate;

    @ApiModelProperty(value = "备注信息")
    @TableField("remarks")
    private String remarks;


}
